package com.colin.utils;

import java.util.ArrayList;
import java.util.Arrays;

public class StringUtils {

    // 字符串分隔
    public static String join(ArrayList objects , String del){
        StringBuffer stringBuffer = new StringBuffer();
        for (Object o : objects) {
            stringBuffer.append(o);
            stringBuffer.append(del);
        }
        String string = stringBuffer.toString();
        return string.substring(0 , string.length() - 1);
    }

    // 解析
    public static ArrayList parse(String string , String del){
        return new ArrayList<Object>(Arrays.asList(string.split(del)));
    }
}
